﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YiLe.UI
{
    public class ApplicationFolderCollection : CollectionBase
    {
        public void Add(ApplicationFolder folder)
        {
            base.List.Add(folder);
        }

        public ApplicationFolder this[int index]
        {
            get { return (ApplicationFolder)(base.List[index]); }
        }

        public ApplicationFolder this[string folderName]
        {
            get
            {
                foreach (ApplicationFolder folder in this.List)
                {
                    if (string.Compare(folder.FolderName, folderName, true) == 0)
                    {
                        return folder;
                    }
                }
                return null;
            }
        }

        public ApplicationFolder this[Type folderType]
        {
            get
            {
                foreach (ApplicationFolder folder in this.List)
                {
                    if (folder.GetType().Equals(folderType))
                    {
                        return folder;
                    }
                }
                return null;
            }
        }
    }
}
